package com.xy.breakfast.mapper;


import com.xy.breakfast.entity.Clients;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClientsMapper extends BaseMapper<Clients> {

    @Select("select * from clients where id=#{id}")
    public Clients getById(int id);

    @Insert("insert into clients values(null,#{email},#{password},#{name},#{age},#{sex},#{phone},#{address})")
    public void save(Clients t);

    @Select("select * from clients where email=#{email}")
    public Clients findByEmail(String email);

    public void deleteById(int id);

    public void update(Clients t);

    public List<Clients> getAll();

    public List<Clients> getPage(int start,int end);
}
